﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace GameDriver
{
    /// <summary>
    /// An abstract class to base custom layers on.
    /// </summary>
    public abstract class Layer
    {
        /// <summary>The parent scene for this layer.</summary>
        public Scene Scene;
        /// <summary>The content handler belonging to this layer's scene.</summary>
        public ContentHandler Content { get { return Scene.Content; } }

        /// <summary>Set to false to stop updating.</summary>
        public bool Paused;
        /// <summary>Set to false to stop rendering.</summary>
        public bool Visible;

        /// <summary>
        /// Base constructor.
        /// </summary>
        public Layer()
        {
            Scene = null;
            Paused = false;
            Visible = true;
        }

        /// <summary>
        /// Update the layer - this is called from the scene, and should never be called directly.
        /// </summary>
        /// <param name="gt">The current running/passed time for the game.</param>
        public abstract void Update(GameTime gt);
        /// <summary>
        /// Draw the layer to the screen - this is called from the scene, and should never be called directly.
        /// </summary>
        /// <param name="sb">The SpriteBatch to use for rendering.</param>
        public abstract void Draw(SpriteBatch sb);

        /// <summary>
        /// Closes the game cleanly.
        /// </summary>
        public void Exit()
        {
            Scene.Exit();
        }
    }
}
